<!DOCTYPE html
  PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- saved from url=(0014)about:internet -->
<html xmlns:MSHelp="http://www.microsoft.com/MSHelp/" lang="en-us" xml:lang="en-us"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

<meta name="DC.Type" content="reference">
<meta name="DC.Title" content="task_group Class Members">
<meta name="DC.subject" content="TestMetaData">
<meta name="keywords" content="TestMetaData">
<meta name="DC.Relation" scheme="URI" content="../../../reference/task_groups/task_group_cls.htm">
<meta name="DC.Format" content="XHTML">
<meta name="DC.Identifier" content="task_group_cls_members">
<meta name="DC.Language" content="en-US">
<link rel="stylesheet" type="text/css" href="../../../intel_css_styles.css">
<title>task_group Class Members</title>
</head>
<body id="task_group_cls_members">
 <!-- ==============(Start:NavScript)================= -->
 <script src="..\..\..\NavScript.js" language="JavaScript1.2" type="text/javascript"></script>
 <script language="JavaScript1.2" type="text/javascript">WriteNavLink(3);</script>
 <!-- ==============(End:NavScript)================= -->
<a name="task_group_cls_members"><!-- --></a>

 
  <h1 class="topictitle1">task_group Class Members</h1>
 
  
  <div> 
	 
<div class="tablenoborder"><table cellpadding="4" summary="" frame="border" border="1" cellspacing="0" rules="all"><span class="tabledesc">The following table provides additional information on the members
		  of this template class. 
		</span><thead align="left"> 
			 <tr> 
				<th class="cellrowborder" valign="top" width="33.89830508474576%" id="d106203e29">Member 
				</th>
 
				<th class="cellrowborder" valign="top" width="66.10169491525423%" id="d106203e32">Description 
				</th>
 
			 </tr>
</thead>
 
		  <tbody> 
			 <tr> 
				<td class="cellrowborder" valign="top" width="33.89830508474576%" headers="d106203e29 "><span class="keyword">task_group()</span> 
				</td>
 
				<td class="cellrowborder" valign="top" width="66.10169491525423%" headers="d106203e32 ">
				  <p>Constructs an empty 
					 <samp class="codeph">task group</samp>.
				  </p>
 
				</td>
 
			 </tr>
 
			 <tr> 
				<td class="cellrowborder" valign="top" width="33.89830508474576%" headers="d106203e29 "><span class="keyword">~task_group()</span> 
				</td>
 
				<td class="cellrowborder" valign="top" width="66.10169491525423%" headers="d106203e32 ">
				  <p><strong>Requires</strong>: Method 
					 <samp class="codeph">wait</samp> must be called before destroying a 
					 <samp class="codeph">task_group</samp>, otherwise the destructor throws an
					 exception. 
				  </p>
 
				</td>
 
			 </tr>
 
			 <tr> 
				<td class="cellrowborder" valign="top" width="33.89830508474576%" headers="d106203e29 "><span class="keyword">template&lt;typename Func&gt; void
					 run( const Func&amp; f )</span> 
				</td>
 
				<td class="cellrowborder" valign="top" width="66.10169491525423%" headers="d106203e32 ">
				  <p>Spawn a task that computes<samp class="codeph"><em>
						  f()</em></samp> and return immediately.
				  </p>
 
				</td>
 
			 </tr>
 
			 <tr> 
				<td class="cellrowborder" valign="top" width="33.89830508474576%" headers="d106203e29 "><span class="keyword">template&lt;typename Func&gt; void
					 run ( task_handle&lt;Func&gt;&amp; handle );</span> 
				</td>
 
				<td class="cellrowborder" valign="top" width="66.10169491525423%" headers="d106203e32 ">
				  <p>Spawn a task that computes 
					 <samp class="codeph"><em>handle()</em></samp> and return immediately.
				  </p>
 
				</td>
 
			 </tr>
 
			 <tr> 
				<td class="cellrowborder" valign="top" width="33.89830508474576%" headers="d106203e29 "><span class="keyword">template&lt;typename Func&gt; void
					 run_and_wait( const Func&amp; f )</span> 
				</td>
 
				<td class="cellrowborder" valign="top" width="66.10169491525423%" headers="d106203e32 ">
				  <p>Equivalent to 
					 <samp class="codeph">{run(<em>f</em>); wait();}</samp>, but guarantees
					 that<samp class="codeph"><em> f</em></samp> runs on the current thread. 
				  </p>
 
				  <div class="Note"><h3 class="NoteTipHead">
					Note</h3>
					 <p>Template method 
						<samp class="codeph">run_and_wait</samp> is intended to be more
						efficient than separate calls to 
						<samp class="codeph">run</samp> and 
						<samp class="codeph">wait</samp>.
					 </p>

				  </div> 
				</td>
 
			 </tr>
 
			 <tr> 
				<td class="cellrowborder" valign="top" width="33.89830508474576%" headers="d106203e29 "><span class="keyword">template&lt;typename Func&gt; void
					 run _and_wait( task_handle&lt;Func&gt;&amp; handle );</span> 
				</td>
 
				<td class="cellrowborder" valign="top" width="66.10169491525423%" headers="d106203e32 ">
				  <p>Equivalent to 
					 <samp class="codeph">{run(<em>handle</em>); wait();}</samp>, but guarantees
					 that 
					 <samp class="codeph"><em>handle()</em></samp> runs on the current thread.
				  </p>
 
				  <div class="Note"><h3 class="NoteTipHead">
					Note</h3>
					 <p>Template method 
						<samp class="codeph">run_and_wait</samp> is intended to be more
						efficient than separate calls to 
						<samp class="codeph">run</samp> and 
						<samp class="codeph">wait</samp>.
					 </p>

				  </div> 
				</td>
 
			 </tr>
 
			 <tr> 
				<td class="cellrowborder" valign="top" width="33.89830508474576%" headers="d106203e29 "><span class="keyword">task_group_status wait()</span> 
				</td>
 
				<td class="cellrowborder" valign="top" width="66.10169491525423%" headers="d106203e32 ">
				  <p>Wait for all tasks in the group to complete
					 or be cancelled.
				  </p>

				  <p><strong>Returns</strong>: True if this task group is
					 cancelling its tasks.
				  </p>
 
				</td>
 
			 </tr>
 
			 <tr> 
				<td class="cellrowborder" valign="top" width="33.89830508474576%" headers="d106203e29 "><span class="keyword">bool is_canceling()</span> 
				</td>
 
				<td class="cellrowborder" valign="top" width="66.10169491525423%" headers="d106203e32 ">
				  <p><strong>Returns</strong>: True if this task group is
					 cancelling its tasks.
				  </p>
 
				</td>
 
			 </tr>

			 <tr>
				<td class="cellrowborder" valign="top" width="33.89830508474576%" headers="d106203e29 "><span class="keyword">void cancel()</span> 
				</td>

				<td class="cellrowborder" valign="top" width="66.10169491525423%" headers="d106203e32 ">
				  <p>Cancel all tasks in this 
					 <samp class="codeph">task_group</samp>.
				  </p>

				</td>

			 </tr>
 
		  </tbody>
 
		</table>
</div>
 
  </div>
 

<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong>&nbsp;<a href="../../../reference/task_groups/task_group_cls.htm">task_group Class</a></div>
</div>
<div></div>

</body>
</html>
